Table Function Format
There are several table functions; however, the format of
the function call is the same:
The
<table name> defines the table to search and
must be a quoted text string.
The key values can be constants; if so, you
must quote the value. On the other hand, if an attribute is being used (such as
pipeline.diameter) for the
<value from key> variable, do not
place it in quotation marks.
table-lookup(dpar-reducer-properties pipeline.diameter length)The <column name> is the name of the column in the table where the desired information is. The column name must be contained in quotation marks.
Example 1: Simple Single Key
A partial listing of the table sample-cost-factors:Table: DPAR-SAMPLE-COST-FACTORS | |
MATERIAL* | COST-FACTORS |
1 1/4 Cr 1/2 Molly | 3.43 |
304 SS/Alloy 20 | 6.0 |
304L SS | 3.44 |
316 Stainless Steel | 4.38 |
5 Cr 1/2 Moly | 4.07 |
9 Cr 1 Moly | 5.5 |
.. | .. |
The function call:
table-lookup(dpar-sample-cost-factors 304L SS costfactor)will yield an output of 3.44.
Example 2: Simple Multiple Keys
Partial listing of pipe-rating-properties.
The function call:
table-round(dpar-pipe-rating-properties 150 20.0 flange-od)will yield an output of 88.9.